package com.wangzifan.mapper;

import com.wangzifan.entity.Course;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CourseMapper {

    @Select("select * from course")
    List<Course> queryCourse();

    @Select("select * from course where id=#{id}")
    Course queryCourseById(Integer id);

    void deleteCourse(List<Integer> ids);

    @Insert("insert into course(cno, cname, create_time, tno) values (#{cno},#{cname},#{createTime},#{tno})")
    void addCourse(Course course);

    void updateCourse(Course course);
}
